package com.harmonk.firstscene.db.entity

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(
    tableName = "vehicles", indices = [Index(value = ["vehicleId"], unique = true)],
    foreignKeys = [ForeignKey(
        entity = TrafficEvent::class,
        parentColumns = ["eventId"],
        childColumns = ["eventId"],
        onDelete = ForeignKey.CASCADE
    )]
)
data class Vehicle(
    @PrimaryKey(autoGenerate = true)
    val vehicleId: Long = 0,
    val name: String = "",
    val carNo: String = "",
    val type: Int = 0,
    val memo: String = "",
    val eventId: Long = -1
)